package com.peaksport.framework.extend.kafka;

import org.springframework.beans.factory.config.BeanDefinition;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Role;
import org.springframework.kafka.annotation.KafkaListenerAnnotationBeanPostProcessor;
import org.springframework.kafka.config.KafkaListenerConfigUtils;

/**
 * 
 * 扩展KafkaBootstrapConfiguration配置
 * 
 * @author jinbin_guo  2019年5月28日 上午11:47:06
 *
 */
@Configuration
public class PKKafkaConfiguration {
	
	/**
	 * 重新注册扩展 KafkaListenerAnnotationBeanPostProcessor
	 * @return
	 */
	@SuppressWarnings("rawtypes")
	@Bean(name = KafkaListenerConfigUtils.KAFKA_LISTENER_ANNOTATION_PROCESSOR_BEAN_NAME)
	@Role(BeanDefinition.ROLE_INFRASTRUCTURE)
	public KafkaListenerAnnotationBeanPostProcessor kafkaListenerAnnotationProcessor() {
		return new PKKafkaListenerAnnotationBeanPostProcessor();
	}
}
